#include "pch.h"
#include "enums.h"

using namespace DXBase;


uint32 DXBase::GetSize(Format fmt)
{
	switch (fmt)
	{
	case DXBase::Format::Unknown:
		throw ref new Platform::FailureException();
	case DXBase::Format::R32G32B32A32_typeless:
	case DXBase::Format::R32G32B32A32_float:
	case DXBase::Format::R32G32B32A32_uint:
	case DXBase::Format::R32G32B32A32_sint:
		return 16;
	case DXBase::Format::R32G32B32_typeless:
	case DXBase::Format::R32G32B32_float:
	case DXBase::Format::R32G32B32_uint:
	case DXBase::Format::R32G32B32_sint:
		return 12;
	case DXBase::Format::R16G16B16A16_typeless:
	case DXBase::Format::R16G16B16A16_float:
	case DXBase::Format::R16G16B16A16_unorm:
	case DXBase::Format::R16G16B16A16_uint:
	case DXBase::Format::R16G16B16A16_snorm:
	case DXBase::Format::R16g16b16a16_sint:
		return 8;
	case DXBase::Format::R32g32_typeless:
	case DXBase::Format::R32g32_float:
	case DXBase::Format::R32g32_uint:
	case DXBase::Format::R32g32_sint:
		return 8;
	case DXBase::Format::R32g8x24_typeless:
		break;
	case DXBase::Format::D32_float_s8x24_uint:
		break;
	case DXBase::Format::R32_float_x8x24_typeless:
		break;
	case DXBase::Format::X32_typeless_g8x24_uint:
		break;
	case DXBase::Format::R10g10b10a2_typeless:
		break;
	case DXBase::Format::R10g10b10a2_unorm:
		break;
	case DXBase::Format::R10g10b10a2_uint:
		break;
	case DXBase::Format::R11g11b10_float:
		break;
	case DXBase::Format::R8g8b8a8_typeless:
	case DXBase::Format::R8g8b8a8_unorm:
	case DXBase::Format::R8g8b8a8_unorm_srgb:
	case DXBase::Format::R8g8b8a8_uint:
	case DXBase::Format::R8g8b8a8_snorm:
	case DXBase::Format::R8g8b8a8_sint:
		return 4;
	case DXBase::Format::R16g16_typeless:
	case DXBase::Format::R16g16_float:
	case DXBase::Format::R16g16_unorm:
	case DXBase::Format::R16g16_uint:
	case DXBase::Format::R16g16_snorm:
	case DXBase::Format::R16g16_sint:
		return 4;
	case DXBase::Format::R32_typeless:
	case DXBase::Format::D32_float:
	case DXBase::Format::R32_float:
	case DXBase::Format::R32_uint:
	case DXBase::Format::R32_sint:
		return 4;
	case DXBase::Format::R24g8_typeless:
		break;
	case DXBase::Format::D24_unorm_s8_uint:
		break;
	case DXBase::Format::R24_unorm_x8_typeless:
		break;
	case DXBase::Format::X24_typeless_g8_uint:
		break;
	case DXBase::Format::R8g8_typeless:
	case DXBase::Format::R8g8_unorm:
	case DXBase::Format::R8g8_uint:
	case DXBase::Format::R8g8_snorm:
	case DXBase::Format::R8g8_sint:
		return 2;
	case DXBase::Format::R16_typeless:
	case DXBase::Format::R16_float:
	case DXBase::Format::D16_unorm:
	case DXBase::Format::R16_unorm:
	case DXBase::Format::R16_uint:
	case DXBase::Format::R16_snorm:
	case DXBase::Format::R16_sint:
		return 2;
	case DXBase::Format::R8_typeless:
	case DXBase::Format::R8_unorm:
	case DXBase::Format::R8_uint:
	case DXBase::Format::R8_snorm:
	case DXBase::Format::R8_sint:
	case DXBase::Format::A8_unorm:
		return 1;
	case DXBase::Format::R1_unorm:
		break;
	case DXBase::Format::R9g9b9e5_sharedexp:
		break;
	case DXBase::Format::R8g8_b8g8_unorm:
		break;
	case DXBase::Format::G8r8_g8b8_unorm:
		break;
	case DXBase::Format::Bc1_typeless:
		break;
	case DXBase::Format::Bc1_unorm:
		break;
	case DXBase::Format::Bc1_unorm_srgb:
		break;
	case DXBase::Format::Bc2_typeless:
		break;
	case DXBase::Format::Bc2_unorm:
		break;
	case DXBase::Format::Bc2_unorm_srgb:
		break;
	case DXBase::Format::Bc3_typeless:
		break;
	case DXBase::Format::Bc3_unorm:
		break;
	case DXBase::Format::Bc3_unorm_srgb:
		break;
	case DXBase::Format::Bc4_typeless:
		break;
	case DXBase::Format::Bc4_unorm:
		break;
	case DXBase::Format::Bc4_snorm:
		break;
	case DXBase::Format::Bc5_typeless:
		break;
	case DXBase::Format::Bc5_unorm:
		break;
	case DXBase::Format::Bc5_snorm:
		break;
	case DXBase::Format::B5g6r5_unorm:
		break;
	case DXBase::Format::B5g5r5a1_unorm:
		break;
	case DXBase::Format::B8g8r8a8_unorm:
		return 4;
	case DXBase::Format::B8g8r8x8_unorm:
		break;
	case DXBase::Format::R10g10b10_xr_bias_a2_unorm:
		break;
	case DXBase::Format::B8g8r8a8_typeless:
	case DXBase::Format::B8g8r8a8_unorm_srgb:
	case DXBase::Format::B8g8r8x8_typeless:
	case DXBase::Format::B8g8r8x8_unorm_srgb:
		return 4;
	case DXBase::Format::Bc6h_typeless:
		break;
	case DXBase::Format::Bc6h_uf16:
		break;
	case DXBase::Format::Bc6h_sf16:
		break;
	case DXBase::Format::Bc7_typeless:
		break;
	case DXBase::Format::Bc7_unorm:
		break;
	case DXBase::Format::Bc7_unorm_srgb:
		break;
	case DXBase::Format::Ayuv:
		break;
	case DXBase::Format::Y410:
		break;
	case DXBase::Format::Y416:
		break;
	case DXBase::Format::Nv12:
		break;
	case DXBase::Format::P010:
		break;
	case DXBase::Format::P016:
		break;
	case DXBase::Format::_420_opaque:
		break;
	case DXBase::Format::Yuy2:
		break;
	case DXBase::Format::Y210:
		break;
	case DXBase::Format::Y216:
		break;
	case DXBase::Format::Nv11:
		break;
	case DXBase::Format::Ai44:
		break;
	case DXBase::Format::Ia44:
		break;
	case DXBase::Format::P8:
		break;
	case DXBase::Format::A8p8:
		return 2;
	case DXBase::Format::B4g4r4a4_unorm:
		return 2;
	case DXBase::Format::Force_uint:
		return 4;
	default:
		break;
	}
	throw ref new Platform::NotImplementedException();
}
